﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<link href="~/Content/css/framework-theme.css" rel="stylesheet" />
<style>
    .zdyGirdPanel {
        width: 100%;
        margin: 0px;
        padding: 0px;
        float: left;
    }

    .zdyUL {
        list-style-type: none;
        margin: 5px 0px 0px -3px;
        padding: 0px;
    }

        .zdyUL li {
            float: left;
            list-style: none;
            height: 24px;
            line-height: 22px;
        }

            .zdyUL li a {
                cursor: pointer;
                padding: 5px 10px;
                border-radius: 4px;
                color: #337ab7;
            }

            .zdyUL li i {
                margin-right: 4px;
                font-size: 13px;
                color: #666;
                vertical-align: middle;
                margin-top: -1px;
            }

            .zdyUL li a:hover {
                text-decoration: none;
                background-color: #1ABC9C;
                color: #fff;
            }

    .zdyBar {
        padding: 0px;
        margin: 0px;
        margin-top: 3px;
    }

    .zdyPanel {
        background-color: #fff;
        border-top: 1px solid #ddd;
        border-left: 1px solid #ddd;
        border-right: 1px solid #ddd;
        margin: 0px;
        float: left;
        width: 100%;
    }

    .ui-jqgrid td input {
        margin-top: 8px;
        margin-left: 7px;
    }

    .form-control {
        height: 30px;
        line-height: 30px;
        padding: 0px;
        border-radius: 2px;
        width: 96%;
    }

    .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
        padding: 3px;
        line-height: 30px;
    }
</style>
<script>
    var F_OrderId = $.request("F_OrderId");
    var F_CheckId = $.request("F_Id");
    var F_FlowId = $.request("F_FlowId");
    var ApplyType = $.request("ApplyType");
    var F_CheckUserId = $.request("F_CheckUserId");
    var F_No = $.request("F_No");
    var orderF_State = $.request("orderF_State")

    var isCheckPrice = false;
    var checkState = false;

    var resultData = {};
    $(function () {
        getItemList();
        gridList();
        if (orderF_State) {
            $("#btn_EditPrice").hide();
            $("#btn_ReturnPrice").hide();
        }
    });

    function getItemList() {
        resultData = getCache("CHECK_ORDERPRICE");
        if (!resultData || resultData.length <= 0) {
            $.ajax({
                url: "/CheckManager/CheckInfos/GetItemsJson",
                dataType: "json",
                async: false,
                success: function (data) {
                    resultData = data;
                    setCache("CHECK_ORDERPRICE", data);
                }, error: function (XMLHttpRequest, textStatus, errorThrown) {

                }
            });
        }
    }

    function Dics(type, value) {
        if (type == "feetype") {
            if (value == "1") {
                return "场地费";
            }
            else if (value == "2") {
                return "搭建费";
            } else if (value == "3") {
                return "安保费";
            } else if (value == "4") {
                return "保洁费";
            } else if (value == "5") {
                return "宽带费";
            } else if (value == "6") {
                return "空调费";
            } else if (value == "7") {
                return "撤场";
            } else if (value == "8") {
                return "电费";
            } else if (value == "9") {
                return "消防";
            } else if (value == "10") {
                return "餐饮费";
            } else if (value == "11") {
                return "加班费";
            } else if (value == "12") {
                return "协助申办服务费";
            }
        } else if (type == "unit") {
            if (value == "1") {
                return "元/天";
            }
            else if (value == "2") {
                return "元/周";
            } else if (value == "3") {
                return "元/月";
            } else if (value == "4") {
                return "元/半天";
            } else if (value == "5") {
                return "元/小时";
            } else if (value == "6") {
                return "㎡/天";
            } else if (value == "7") {
                return "元/场";
            } else if (value == "8") {
                return "元/人";
            } else if (value == "9") {
                return "元/度(电)";
            } else if (value == "10") {
                return "元/m³(水)";
            } else if (value == "11") {
                return "元/个";
            }
        } else if (type == "city") {
            var citys = value.split(',');
            var html = "";
            for (var i = 0; i < resultData.City.length; i++) {
                for (var j = 0; j < citys.length; j++) {
                    if (citys.length == 1) {
                        if (citys[j] == resultData.City[i]["F_EnCode"]) {
                            html += resultData.City[i]["F_FullName"];
                        }
                    } else {
                        if (j == citys.length - 1) {
                            if (citys[j] == resultData.City[i]["F_EnCode"]) {
                                html += resultData.City[i]["F_FullName"];
                            }
                        } else {
                            if (citys[j] == resultData.City[i]["F_EnCode"]) {
                                html += resultData.City[i]["F_FullName"]+',';
                            }
                        }
                    }
                }
            }
            return html;
        }
    }

    function gridList() {
        var F_No = $.request("F_No");
        var queryJson = {
            F_OrderId: F_OrderId, F_CheckUserId: F_CheckUserId, F_No: F_No
        };
        $.ajax({
            url: "/CheckManager/CheckInfos/GetCheckPrice",
            dataType: "json",
            async: false,
            data: { queryJson: JSON.stringify(queryJson)},
            success: function (data) {
                if (data != null) {
                    console.log(data);
                    var siteBS = "";
                    for (var i = 0; i < data.length; i++) {
                        if (i == 0) {
                            $("#F_ActivityTheme").html(data[i]["F_ActivityTheme"]);
                            $("#F_ActivityCityId").html(Dics("city",data[i]["F_ActivityCityId"]));
                            var nrow = "<tr>";
                            nrow += "<td><label id=\"" + data[i]["F_SiteId"] +"\">" + data[i]["SiteName"] + "</label></td>";
                            nrow += "<td><label id=\"" + data[i]["F_SpaceId"] +"\">" + data[i]["SpaceName"] + "</label></td>";
                            nrow += "<td><label>" + data[i]["F_StartDate"] + "至" + data[i]["F_EndDate"] + "</label></td>";
                            nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\" selected=\"selected\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                            if (data[i]["F_PriceUnit"] == "1" || data[i]["F_PriceUnit"] == null || data[i]["F_PriceUnit"] == "") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\" selected=\"selected\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "1") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\" selected=\"selected\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "5") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\" selected=\"selected\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "2") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\" selected=\"selected\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "3") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\" selected=\"selected\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "4") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\" selected=\"selected\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "6") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\" selected=\"selected\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "7") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\" selected=\"selected\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "8") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\" selected=\"selected\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "9") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\" selected=\"selected\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "10") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\" selected=\"selected\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                            } else if (data[i]["F_PriceUnit"] == "11") {
                                nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\" selected=\"selected\">元/个</option></select></td>";
                            }

                            nrow += "<td><label>" + data[i]["F_Area"] + "</label></td>";
                            nrow += "<td><input name=\"F_MarketPrice\" type=\"text\" class=\"form-control number required\" placeholder=\"市场刊例价\" value=\"" + data[i]["F_MarketPrice"] + "\" /></td>";
                            nrow += "<td><input name=\"F_YunPrice\" onchange=\"textChange(this)\" type=\"text\" class=\"form-control number required\" placeholder=\"YUNSPACE价\" value=\"" + data[i]["F_YunPrice"] + "\" /></td>";

                            nrow += "<td><input name=\"F_SalePrice\"  type=\"text\" class=\"form-control number required\" placeholder=\"销售价\" value=\"" + data[i]["F_SalePrice"] + "\" /></td>";

                            nrow += "<td><input name=\"F_Days\" type=\"text\" onchange=\"textChange(this)\" class=\"form-control number\" value=\"" + data[i]["F_Days"] + "\" /></td>";
                            nrow += "<td><input name=\"totalPrice\" onchange=\"TotalPrice(this)\" type=\"text\" class=\"form-control number\" value=\"" + parseFloat(data[i]["F_YunPrice"]) * parseFloat(data[i]["F_Days"]) + "\" /></td>";
                            siteBS = data[i]["F_SpaceId"];
                            nrow += "</tr>";
                            if (data[i]["F_ServiceCode"] != null) {
                                nrow += "<tr>";
                                nrow += "<td><label id=\"" + data[i]["F_SiteId"] + "\"></label></td>";
                                nrow += "<td><label id=\"" + data[i]["F_SpaceId"] + "\"></label></td>";
                                nrow += "<td><label></label></td>";
                                if (data[i]["F_ServiceCode"] == "1") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\" selected=\"selected\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "2") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\" selected=\"selected\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "3") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\" selected=\"selected\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "4") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\" selected=\"selected\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "5") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\" selected=\"selected\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "6") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\" >安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\" selected=\"selected\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "7") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\" selected=\"selected\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "8") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\" selected=\"selected\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "9") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\" selected=\"selected\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "10") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\" selected=\"selected\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "11") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\" selected=\"selected\">加班费</option><option value=\"12\" >协助申办服务费</option></select></td>";
                                } else if (data[i]["F_ServiceCode"] == "12") {
                                    nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\" selected=\"selected\">协助申办服务费</option></select></td>";
                                }

                                if (data[i]["F_PriceUnit"] == "1" || data[i]["F_PriceUnit"] == null || data[i]["F_PriceUnit"] == "") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\" selected=\"selected\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "1") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\" selected=\"selected\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "5") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\" selected=\"selected\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "2") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\" selected=\"selected\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "3") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\" selected=\"selected\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "4") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\" selected=\"selected\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "6") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\" selected=\"selected\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "7") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\" selected=\"selected\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "8") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\" selected=\"selected\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "9") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\" selected=\"selected\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "10") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\" selected=\"selected\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "11") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\" selected=\"selected\">元/个</option></select></td>";
                                }

                                if (data[i]["F_ServiceCode"] == "2") {
                                    nrow += "<td><label>" + data[i]["F_Area"] + "</label></td>";
                                    nrow += "<td><input name=\"F_MarketPrice\" type=\"text\" class=\"form-control number required\" placeholder=\"市场刊例价\" value=\"" + data[i]["F_MarketPrice"] + "\" /></td>";
                                    nrow += "<td><input name=\"F_YunPrice\" onchange=\"textChange(this)\" type=\"text\" class=\"form-control number required\" placeholder=\"YUNSPACE价\" value=\"" + data[i]["F_YunPrice"] + "\" /></td>";
                                    nrow += "<td><input name=\"F_SalePrice\"  type=\"text\" class=\"form-control number required\" placeholder=\"销售价\" value=\"" + data[i]["F_SalePrice"] + "\" /></td>";

                                    nrow += "<td><input name=\"F_Num\" type=\"text\" onchange=\"textChange(this)\" class=\"form-control number\" value=\"" + data[i]["F_Num"] + "\" /></td>";
                                    nrow += "<td><input name=\"totalPrice\" type=\"text\" class=\"form-control\" value=\"" + parseFloat(data[i]["F_YunPrice"]) * parseFloat(data[i]["F_Num"]) + "\" /></td>";
                                } else {
                                    nrow += "<td><label></label></td>";
                                    nrow += "<td><input name=\"F_MarketPrice\" type=\"text\" class=\"form-control number required\" placeholder=\"市场刊例价\" value=\"0\" /></td>";
                                    nrow += "<td><input name=\"F_YunPrice\" onchange=\"textChange(this)\" type=\"text\" class=\"form-control number required\"  value=\"0\" placeholder=\"YUNSPACE价\" /></td>";
                                    nrow += "<td><input name=\"F_SalePrice\"  type=\"text\" class=\"form-control number required\" placeholder=\"销售价\" value=\"0\" /></td>";

                                    nrow += "<td><input name=\"F_Num\" type=\"text\" onchange=\"textChange(this)\" class=\"form-control number\" value=\"" + data[i]["F_Num"] + "\" /></td>";
                                    nrow += "<td><input name=\"totalPrice\" type=\"text\" class=\"form-control number\" value=\"0\" /></td>";
                                }
                                nrow += "</tr>";
                            }

                            $("#newTable").append(nrow);
                        } else {
                            if (siteBS == data[i]["F_SpaceId"]) {
                                if (data[i]["F_ServiceCode"] != null) {
                                    var nrow = "<tr>";
                                    nrow += "<td><label id=\"" + data[i]["F_SiteId"] + "\"></label></td>";
                                    nrow += "<td><label id=\"" + data[i]["F_SpaceId"] + "\"></label></td>";
                                    nrow += "<td><label></label></td>";
                                    if (data[i]["F_ServiceCode"] == "1") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\" selected=\"selected\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "2") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\" selected=\"selected\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "3") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\" selected=\"selected\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "4") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\" selected=\"selected\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "5") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\" selected=\"selected\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "6") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\" >安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\" selected=\"selected\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "7") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\" selected=\"selected\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "8") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\" selected=\"selected\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "9") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\" selected=\"selected\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "10") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\" selected=\"selected\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "11") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\" selected=\"selected\">加班费</option><option value=\"12\" >协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "12") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\" selected=\"selected\">协助申办服务费</option></select></td>";
                                    }

                                    if (data[i]["F_PriceUnit"] == "1" || data[i]["F_PriceUnit"] == null || data[i]["F_PriceUnit"] == "") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\" selected=\"selected\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "1") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\" selected=\"selected\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "5") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\" selected=\"selected\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "2") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\" selected=\"selected\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "3") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\" selected=\"selected\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "4") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\" selected=\"selected\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "6") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\" selected=\"selected\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "7") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\" selected=\"selected\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "8") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\" selected=\"selected\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "9") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\" selected=\"selected\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "10") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\" selected=\"selected\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "11") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\" selected=\"selected\">元/个</option></select></td>";
                                    }

                                    nrow += "<td><label></label></td>";
                                    nrow += "<td><input name=\"F_MarketPrice\" type=\"text\" class=\"form-control required\" placeholder=\"市场刊例价\" value=\"0\" /></td>";
                                    nrow += "<td><input name=\"F_YunPrice\" onchange=\"textChange(this)\" type=\"text\" class=\"form-control number required\" placeholder=\"YUNSPACE价\" value=\"0\" /></td>";

                                    nrow += "<td><input name=\"F_SalePrice\"  type=\"text\" class=\"form-control number required\" placeholder=\"销售价\" value=\"0\" /></td>";

                                    nrow += "<td><input name=\"F_Num\" type=\"text\" onchange=\"textChange(this)\" class=\"form-control number\" value=\"" + data[i]["F_Num"] + "\" /></td>";
                                    nrow += "<td><input name=\"totalPrice\" type=\"text\" class=\"form-control number\" value=\"0\" /></td>";

                                    nrow += "</tr>";
                                    $("#newTable").append(nrow);
                                }
                            } else {
                                siteBS == data[i]["F_SpaceId"]
                                var nrow = "<tr>";
                                nrow += "<td><label id=\"" + data[i]["F_SiteId"] + "\">" + data[i]["SiteName"] + "</label></td>";
                                nrow += "<td><label id=\"" + data[i]["F_SpaceId"] + "\">" + data[i]["SpaceName"] + "</label></td>";
                                nrow += "<td><label>" + data[i]["F_StartDate"] + "至" + data[i]["F_EndDate"] + "</label></td>";
                                nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\" selected=\"selected\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                if (data[i]["F_PriceUnit"] == "1" || data[i]["F_PriceUnit"] == null || data[i]["F_PriceUnit"] == "") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\" selected=\"selected\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "1") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\" selected=\"selected\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "5") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\" selected=\"selected\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "2") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\" selected=\"selected\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "3") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\" selected=\"selected\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "4") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\" selected=\"selected\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "6") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\" selected=\"selected\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "7") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\" selected=\"selected\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "8") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\" selected=\"selected\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "9") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\" selected=\"selected\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "10") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\" selected=\"selected\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                } else if (data[i]["F_PriceUnit"] == "11") {
                                    nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\" selected=\"selected\">元/个</option></select></td>";
                                }

                                nrow += "<td><input name=\"F_Area\" type=\"text\" class=\"form-control number\" value=\"" + data[i]["F_Area"] + "\"/></td>";
                                nrow += "<td><input name=\"F_MarketPrice\" type=\"text\" class=\"form-control number required\" placeholder=\"市场刊例价\" value=\"" + data[i]["F_MarketPrice"] + "\" /></td>";
                                nrow += "<td><input name=\"F_YunPrice\" onchange=\"textChange(this)\" type=\"text\" class=\"form-control number required\" placeholder=\"YUNSPACE价\" value=\"" + data[i]["F_YunPrice"] + "\" /></td>";

                                nrow += "<td><input name=\"F_SalePrice\"  type=\"text\" class=\"form-control number required\" placeholder=\"销售价\" value=\"" + data[i]["F_SalePrice"]+"\" /></td>";

                                nrow += "<td><input name=\"F_Days\" type=\"text\" onchange=\"textChange(this)\" class=\"form-control number\" value=\"" + data[i]["F_Days"] + "\" /></td>";
                                nrow += "<td><input name=\"totalPrice\" type=\"text\" class=\"form-control number\" value=\"" + parseFloat(data[i]["F_YunPrice"]) * parseFloat(data[i]["F_Days"]) + "\" /></td>";
                                siteBS = data[i]["F_SpaceId"];
                                nrow += "</tr>";
                                if (data[i]["F_ServiceCode"] != null) {
                                    nrow += "<tr>";
                                    nrow += "<td><label id=\"" + data[i]["F_SiteId"] + "\"></label></td>";
                                    nrow += "<td><label id=\"" + data[i]["F_SpaceId"] + "\"></label></td>";
                                    nrow += "<td><label></label></td>";
                                    if (data[i]["F_ServiceCode"] == "1") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\" selected=\"selected\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "2") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\" selected=\"selected\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "3") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\" selected=\"selected\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "4") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\" selected=\"selected\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "5") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\" selected=\"selected\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "6") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\" >安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\" selected=\"selected\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "7") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\" selected=\"selected\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "8") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\" selected=\"selected\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "9") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\" selected=\"selected\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "10") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\" selected=\"selected\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\">协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "11") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\" selected=\"selected\">加班费</option><option value=\"12\" >协助申办服务费</option></select></td>";
                                    } else if (data[i]["F_ServiceCode"] == "12") {
                                        nrow += "<td><select name=\"F_FeeType\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"1\">场地费</option><option value=\"2\">搭建费</option><option value=\"3\">安保费</option><option value=\"4\">保洁费</option><option value=\"5\">宽带费</option><option value=\"6\">空调费</option><option value=\"7\">撤场</option><option value=\"8\">电费</option><option value=\"9\">消防</option><option value=\"10\">餐饮费</option><option value=\"11\">加班费</option><option value=\"12\" selected=\"selected\">协助申办服务费</option></select></td>";
                                    }


                                    if (data[i]["F_PriceUnit"] == "1" || data[i]["F_PriceUnit"] == null || data[i]["F_PriceUnit"] == "") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\" selected=\"selected\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "1") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\" selected=\"selected\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "5") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\" selected=\"selected\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "2") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\" selected=\"selected\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "3") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\" selected=\"selected\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "4") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\" selected=\"selected\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "6") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\" selected=\"selected\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "7") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\" selected=\"selected\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "8") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\" selected=\"selected\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "9") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\" selected=\"selected\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "10") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\" selected=\"selected\">元/m³(水)</option><option value=\"11\">元/个</option></select></td>";
                                    } else if (data[i]["F_PriceUnit"] == "11") {
                                        nrow += "<td><select name=\"F_Units\" class=\"form-control required\"><option value=\"\">请选择</option><option value=\"7\">元/场</option><option value=\"1\">元/天</option><option value=\"5\">元/小时</option><option value=\"2\">元/周</option><option value=\"3\">元/月</option><option value=\"4\">元/半天</option><option value=\"6\">㎡/天</option><option value=\"8\">元/人</option><option value=\"9\">元/度(电)</option><option value=\"10\">元/m³(水)</option><option value=\"11\" selected=\"selected\">元/个</option></select></td>";
                                    }

                                    nrow += "<td><label></label></td>";
                                    nrow += "<td><input name=\"F_MarketPrice\" type=\"text\" class=\"form-control required number\" placeholder=\"市场刊例价\" value=\"0\" /></td>";
                                    nrow += "<td><input name=\"F_YunPrice\" onchange=\"textChange(this)\" type=\"text\" class=\"form-control required number\" placeholder=\"YUNSPACE价\" value=\"0\" /></td>";
                                    nrow += "<td><input name=\"F_SalePrice\"  type=\"text\" class=\"form-control number required\" placeholder=\"销售价\" value=\"0\" /></td>";

                                    nrow += "<td><input name=\"F_Num\" type=\"text\" onchange=\"textChange(this)\" class=\"form-control number\" value=\"" + data[i]["F_Num"] + "\" /></td>";
                                    nrow += "<td><input name=\"totalPrice\" type=\"text\" class=\"form-control number\" value=\"0\" /></td>";

                                    nrow += "</tr>";
                                }
                                $("#newTable").append(nrow);
                            }
                        }
                    }
                    TotalPrice();
                }
            }, error: function (XMLHttpRequest, textStatus, errorThrown) {

            }
        });
    }

    function textChange(obj) {
        var newRow = $(obj).parent().parent();
        newRow[0].cells[10].children[0].value = parseFloat(newRow[0].cells[7].children[0].value) * parseInt(newRow[0].cells[9].children[0].value);
        TotalPrice();
    }

    function TotalPrice() {
        var count = 0;
        var marketprice = 0;
        var yunprice = 0;
        $("#newTable tbody tr").each(function () {
            var ntr = $(this);
            count += parseFloat(ntr[0].children[10].children[0].value);
            //marketprice += parseFloat(ntr[0].children[5].children[0].value);
            //yunprice += parseFloat(ntr[0].children[6].children[0].value);
        });
        $("#sp_totalPrice").html(count);
        //$("#sp_totalMarketPrice").html(marketprice);
        //$("#sp_totalYunPrice").html(yunprice);
    }
</script>
<form id="form1">
    
    <div style="padding-top: 5px;">
        <table class="form ui-jqgrid-htable ui-common-table table table-bordered">
            <tr class="ui-jqgrid-labels">
                <td class="formTitle">活动名称</td>
                <td><span id="F_ActivityTheme"></span></td>
            </tr>
            <tr class="ui-jqgrid-labels">
                <td class="formTitle">活动城市</td>
                <td><span id="F_ActivityCityId"></span></td>
            </tr>
        </table>
        <table class="form ui-jqgrid-htable ui-common-table table table-bordered" id="newTable">
            <thead>
                <tr class="ui-jqgrid-labels">
                    <th class="ui-th-column ui-th-ltr">场地名称</th>
                    <th class="ui-th-column ui-th-ltr">使用空间</th>
                    <th class="ui-th-column ui-th-ltr">活动档期</th>
                    <th class="ui-th-column ui-th-ltr" style="width:80px;">费用类品</th>
                    <th class="ui-th-column ui-th-ltr" style="width:60px;">单位</th>
                    <th class="ui-th-column ui-th-ltr" style="width:80px;">使用面积(㎡)</th>
                    <th class="ui-th-column ui-th-ltr" style="width:100px;">市场刊例价(元)</th>
                    <th class="ui-th-column ui-th-ltr" style="width:100px;">YUNSPACE底价(元)</th>
                    <th class="ui-th-column ui-th-ltr" style="width:100px;">销售价(元)</th>
                    <th class="ui-th-column ui-th-ltr" style="width:40px;">数量</th>
                    <th class="ui-th-column ui-th-ltr" style="width:80px;">合计价格(元)</th>
                </tr>
            </thead>
            <tbody></tbody>
            <tfoot>
                <tr>
                    <td colspan="10"><span style="float:right;font-weight:bold;">合计价</span></td>
                    <td><span id="sp_totalPrice" style="color:#D9534F"></span></td>
                </tr>
            </tfoot>
        </table>
    </div>
</form>

